<!DOCTYPE html>
<html lang="zxx">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="icon" href="images/favicon.png">
    <title></title>

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="../css/materialize.css">
    <link rel="stylesheet" href="../css/loaders.css">
    <link rel="stylesheet" href="../css/lightbox.css">
    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
    <link rel="stylesheet" href="../css/owl.carousel.min.css">
    <link rel="stylesheet" href="../css/owl.theme.default.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/layer.css">

</head>
<style>

</style>
<body>

<!-- navbar -->
<div class="navbar">
    <div class="container">
        <div class="row">
            <div class="col s9">
                <div class="content-left" onclick="javascript:history.back(-1);">
                    <i class="fa fa-chevron-left center"></i>
                </div>
            </div>

        </div>
    </div>

</div>
<!-- end navbar -->

<!-- sidebar -->

<!-- end sidebar -->

<!-- list -->
<div class="segments-page">
    <div class="pages-title">
        <h3>买入记录</h3>
        <div class="line"></div>
    </div>
    <div class="container weui-content">

        <div class="weui-tab">
            <div class="weui-navbar" style=" top:110px; left:0; right:0; height:44px; background:#fff;">
                <a class="weui-navbar__item proinfo-tab-tit font-14 weui-bar__item--on" href="#tab1">发布中</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14" href="#tab2">交易中</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14" href="#tab3">交易完成</a>
            </div>
            <div class="weui-tab__bd proinfo-tab-con" style="padding-top:18px;">
                <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
                    <div class="weui-panel jyjl" id="issuehtml">
                    
                    </div>
                </div>
                <div id="tab2" class="weui-tab__bd-item" >
                    <div class="weui-panel jyjl" id="trading">
                 
                        
                    </div>
                </div>
                <div id="tab3" class="weui-tab__bd-item">
                    <div class="weui-panel jyjl" id="complete">
                   
                      
                        
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>
<!-- end list -->

<script src="../js/jquery.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="../js/numscroller.js"></script>
<script src="../js/lightbox.js"></script>
<script src="../js/owl.carousel.min.js"></script>
<script src="../js/main.js"></script>
<script src="../js/layer.js"></script>
<script src="../js/jquerysession.js"></script>
<script src="../js/jquery.md5.js"></script>
<script src="../js/index.js"></script>
<script src="../js/jquery-weui.min.js"></script>
<script>

    $(document).ready(function () {
        var OrderLiseUrl = 'Order/OrderLise';
        var OrderLise = api_request(OrderLiseUrl, 'GET');

		if(OrderLise.code==1 && OrderLise.data !='' ){
			var data= OrderLise.data;
				    var issuehtml = "";//发布中
					var tradinghtml="";//交易中
					var completehtml="";//交易完成
			for(var i=0;i<data.length;i++){
				var ls=data[i];
				var patterntype=ls.patterntype == 0 ?'银行卡':'支付宝';
				var Moneystatus=ls.Moneystatus == 1 ?'已付款':'未付款';		
				var type=ls.pattern == 0 ?'银行卡':'支付宝';
				if(ls.Moneystatus==2){
					button= " <button class='button' onclick='GetPay("+ls.id+"); '><i class='fa fa-send'></i>前往付款</button>"
					order_timeHtml=""
				}else {
						button= " <button class='button'><i class='fa fa-send'></i>等待确认</button>"
						order_timeHtml="<li class='weui-media-box__info__meta' style='display: inline;color: #e53935;'>支付时间：<em class='num'>"+ls.payment_time+"</em>"
				}
				if(ls.status==1 && ls !=''){
	 issuehtml
			+= ''
			  + ' <div class="weui-panel__bd">'
			+ '   <div class="weui-media-box weui-media-box_text">'
			+ '      <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
			+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
			+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
					+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
					+ '     <p class="weui-media-box__desc"  >支付方式：'+type+'</p>'
			+ '       <ul class="weui-media-box__info"> '
			+ '       <li class="weui-media-box__info__meta">发布时间：<em class="num">'+ls.add_time+'</em>'
			+ ' </li> '
			+ ' </ul> '
			+ '  </div>'
			 + '  </div>'
			;
				}
		if(ls.status==2 && ls !='' ){
		tradinghtml
				+= ''
				  + ' <div class="weui-panel__bd">'
				+ '   <div class="weui-media-box weui-media-box_text">'
				+ '      <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
				+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
				+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
						+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
						+'<p></p>'
						+ ' <p class="weui-media-box__desc"  style="display: inline;">交易方式：'+patterntype+'</p>'
			+ ' <p class="weui-media-box__desc"  style="display: inline;">是否打款：<p  style="display: inline;color: #e53935;">'+Moneystatus+'</p></p>'
				+ '       <ul class="weui-media-box__info"> '
				+ '       <li class="weui-media-box__info__meta">发布时间：<em class="num">'+ls.add_time+'</em>'
				+ '       <li class="weui-media-box__info__meta">下单时间：<em class="num">'+ls.order_time+'</em>'
					+ order_timeHtml
				+ ' </li> '
				+ ' </ul> '
					+ button
				+ '  </div>'
				 + '  </div>'
				;
					}
					if(ls.status==3 && ls !=''){
					completehtml
							+= ''
							  + ' <div class="weui-panel__bd">'
							+ '   <div class="weui-media-box weui-media-box_text">'
							+ '      <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
							+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
							+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
									+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
									+'<p></p>'
									+ '     <p class="weui-media-box__desc"  style="display: inline;">交易方式：'+patterntype+'</p>'
											+ ' <p class="weui-media-box__desc"  style="display: inline;" >付款状态：'+Moneystatus+'</p>'
							+ '       <ul class="weui-media-box__info"> '
							+ '       <li class="weui-media-box__info__meta">发布时间：<em class="num">'+ls.add_time+'</em>'
							+ '       <li class="weui-media-box__info__meta">下单时间：<em class="num">'+ls.order_time+'</em>'
								+ '       <li class="weui-media-box__info__meta">完成时间：<em class="num">'+ls.payment_time+'</em>'
							+ ' </li> '
							+ ' </ul> '
							+ '  </div>'
							 + '  </div>'
							;
								}
				}
				var issuehtmllist = document.getElementById("issuehtml");
				issuehtmllist.innerHTML += issuehtml;
				
				var tradinglist = document.getElementById("trading");
				tradinglist.innerHTML += tradinghtml;
				
				var completelist = document.getElementById("complete");
				completelist.innerHTML += completehtml;
		
				
				
		}
		
    });
	
	function GetPay(Oid){
			var GetPayUrl = 'Order/GetPay?Oid='+Oid;
			var GetPayInfo = api_request(GetPayUrl, 'GET');
			console.log(GetPayInfo)
	}
// function affirm(Oid){
// 	  layer.open({
// 	    content: '确认收到？'
// 	    ,btn: ['稍等', '确认']
// 	    ,yes: function(index){
// 	var affirmUrlUrl = 'Order/affirmUrl?Oid='+Oid;
// 	var affirmUrl = api_request(affirmUrlUrl, 'GET');
// if(affirmUrl.code==1){
// 	layer.open({
// 	    content: affirmUrl.data
// 	    , skin: 'msg'
// 	    , time: 1//2秒后自动关闭
// 	    , end: function () {
// 	      layer.close(index);
// 	    }
// 	});
// }
		
// 	    }
// 	  });
// }

</script>
</body>
</html>